package com.zqxq.api;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import com.zqxq.util.HttpClientHelper;
import com.zqxq.util.Signature;
import com.zqxq.util.paramSort;

import net.sf.json.JSONObject;

public class usercenterApi {
	
	
	public static JSONObject usercenterPost(String url,String phone,String passwd) throws IOException 
	{
		JSONObject Result = null;
		List<NameValuePair> data = new ArrayList<NameValuePair>();
		data.add(new BasicNameValuePair("phone", phone));
        data.add(new BasicNameValuePair("login_pwd", passwd));
        paramSort ps = new paramSort();
        //请求实体排序
        String paramsort = ps.sortParam(data);
        //生成签名
        Signature sign = new Signature();
       // String signstr = sign.signatureBuild(paramsort);        
		HttpClientHelper httphelper = new HttpClientHelper();
		//登录
		LoginAPI.Login(httphelper);
		//请求时传3个参数，请求地址、请求数据和签名
	//	Result = HttpClientHelper.getJSONObjectByPost(url,data,signstr);
		//测试单个接口调用此方法      HttpClientHelper.closeClient();
		return Result;
		
	}

}
